package example.pattern.state;

import java.util.ArrayList;
import java.util.List;

public class StateContext {
	private List<String> list = new ArrayList<String>();
	
	State state;
	
	public void setState(State state){
		this.state = state;
	}
	
	public StateContext add(String string){
		list.add(string);
		this.state.print(this, string);
		return this;
	}

	public int getCounter(){
		return list.size();
	}
	
	public void print(String str){
		System.out.println(str);
	}

}
